//
//  favoriteView.m
//  QingTengGaoXiao
//
//  Created by 沈煜航 on 2018/10/6.
//  Copyright © 2018年 QingTeng. All rights reserved.
//

#import "favoriteView.h"

@interface favoriteView()<UITableViewDelegate,UITableViewDataSource>
//存放总数据
@property (nonatomic,strong) NSMutableArray *dataArray;
@end

@implementation favoriteView

#pragma 重写init

-(instancetype)initWithFrame:(CGRect)frame{
    self = [super initWithFrame:frame];
    if(self){
        self = [[[NSBundle mainBundle] loadNibNamed:NSStringFromClass([self class]) owner:nil options:nil] objectAtIndex:0];
        [self initBeforeAll];
    }
    return self;
}

#pragma 初始化方法

-(void)initBeforeAll{
    self.tableView.delegate = self;
    self.tableView.dataSource = self;
    [self initSchoolView];
}

-(void)initSchoolView{
    self.schoolChosenView.hidden = NO;
    self.majorChosenView.hidden = YES;
    //从model载入进dataArray
    
    
    
}

-(void)initMajorView{
    self.schoolChosenView.hidden = YES;
    self.majorChosenView.hidden = NO;
    //从model载入进dataArray
    
    
}

#pragma 代理方法



#pragma public方法

-(void)changeTitle{
    UIView* rootView = self.superview.superview;
    for(UIView* view in rootView.subviews){
        if(view.tag == 123){
            rootView = view;
            break;
        }
    }
    for(UIView* view in rootView.subviews){
        if(view.tag == 123){
            UILabel* titleLabel = (UILabel*)view;
            [titleLabel setText:@"个人收藏"];
            break;
        }
    }
}

#pragma 按钮的action

- (IBAction)headButtonsAction:(UIButton *)sender {
    switch (sender.tag) {
        case 1:
            [self initSchoolView];
            break;
        case 2:
            [self initMajorView];
            break;
        default:
            break;
    }
}
@end
